home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Hot Mix 14
/
Hot Mix 14.iso
/
HTML
/
vendors
/
finesse
/
examples
/
sh
/
kill_sleep
< prev
next >
Wrap
Text File
|
1996-06-27
|
1KB
|
68 lines
#! /bin/sh
# FINESSEAPPLICATIONKEY sIHCQghxQSmV]
#
# Demo script for killing processes
# For demo purposes two sleep processes
# are created that may be safely killed
# First check for tty
tty -s || { echo "Need a tty. Exiting." ; exit 1 ; }
. ${FINESSEPATH-/usr/local/finesse}/fsshinit
# generate two processes for killing
#
sleep 60 &
sleep 60 &
# Declare window with list of processes
#
nl="
"
psitems="`ps`"
windef="
FsWindow -name killwin -bdefault exit
-title 'kill processes';
FsSeparator;
FsList -label Processes:
-items '$psitems'
-nvisible 5
-mode multiple
-inputsep '$nl'
-outputsep '$nl'
-var killlist
-expert kill;
FsPushButton -label kill -fsbutton k
-name kill;
FsPushButton -type x;
FsPushButton -label exit -nrows 1
-name exit;"
# Open server and display window
#
Fsopen -o 2 "$@"
Fsdisplay -w "$windef" \
-m "Select processes to kill:"
# Kill selected processes
#
if [ "$fsbutton" = "k" -a -n "$killlist" ] ; then
echo "$killlist" |
awk '$1 !~ /PID/ {print $1}' |
xargs kill
sleep 5 # time to display kill message
fi
Fsclose